package nl.ViewerServer.ServerManager.DataManager.Objects;

import java.util.HashMap;

public class Dataset {
   public final int                           datasetId;
   public final String                        name;
   public final String                        description;
   public final transient String              datasetACL;

   protected final HashMap<Integer, Modality> modalities = new HashMap<Integer, Modality>();

   public Dataset( int datasetId, String name, String description, String datasetACL ) {
      this.datasetId = datasetId;
      this.name = name;
      this.description = description;
      this.datasetACL = datasetACL;
   }

   public void addModality( Modality modality ) {
      modalities.put( modality.modalityId, modality );
   }

   public Modality getModality( int modalityId ) {
      return modalities.get( modalityId );
   }

   public String toString() {
      return "Dataset: [" + datasetId + "/" + name + "/" + description + "/modalities: " + modalities.size() + "]";
   }

   public String getDatasetACL() {
      return datasetACL;
   }

   public Dataset clone() {
      // create a deep copy of the dataset
      Dataset clone = new Dataset( this.datasetId, this.name, this.description, this.datasetACL );
      return clone;
   }

   public HashMap<Integer, Modality> getModalities() {
      return modalities;
   }

   
}
